<template>
 <div>
  
  御剑乘风来,除魔天地间!=====Father======{{ $store.state.num }}======{{ num }}====={{ str }}==={{ age }}====<button @click="change1()">+10</button>
 
 <button @click="actions()">11111111111</button>
 <hr>
 <button @click="qiuhe()">求和:{{ $store.getters.total }}</button>
 <hr>
 <button @click="agechange">年龄</button>======{{ $store.state.setting.userInfo.age }}
 </div>
</template>
<script>

import { mapState ,mapMutations,mapActions, mapGetters} from 'vuex';
export default{
    name:'',
    data () {
        return {
            obj:{
              n:10
            }
        }
    },
    created () {
      console.log(this.$store.state.setting.userInfo.age);
    },
    computed:{
      ...mapGetters(['total']),
      num(){
        return this.$store.state.num
      },
      ...mapState(['str','age'])
    },
    methods:{
      ...mapMutations(['change']),
      ...mapActions(['actionsyibu']),
      
      actions(){
        this.actionsyibu(6)
        console.log(this.$store);
      },
      change1(){
        console.log(this.$store);
        this.$store.commit('change',this.obj)
      },
      qiuhe(){
        console.log(this.$store);
        // this.$store.getters.total
      },
      agechange(){
        this.$store.commit('setting/Shandel')
      }
    }
}
</script>
<style lang='less'  scoped>
    
</style>
